This guide provides a detailed walkthrough on setting up and deploying a Primary Sales Contract in Builder. It discusses the differences between ERC721 and ERC1155 contracts, walks through the steps of deploying a contract.
Step 1: Navigate to contracts
project
you would like to create a sale for and head to Contracts > Deploy
.Step 2: Deploy your chosen collectible contract
Step 3: Deploy your Primary Sales contract
+ Deploy new contract
again. Then select the appropriate ERC721 or ERC1155 sale contract that corresponds to your previously deployed collectible contract in step 2 and click Deploy sale contract
.Step 4: Set your mint details on the Primary Sales contract.
Supply Cap
: This is the amount of supply of tokens that users can mint via the Sale contractCost
: Is the cost amount in GWEI of minting a single token. In this example, we set it to 0 to easily mint from Builder, but when deploying in production this should match what you wish to charge your users.Start and End Time
: Start and end time of the sale. If the current time is within the date range provided, this will activate the sale. Consider setting the date range to the future if desired.Payment Token
: You can select the native token on the chain or a custom currency as well that the sale is in.Sale Type
: You can also opt to choose between a Public or Private mint. When selecting a private mint, you can also choose a list of allowlisted participants that is uploaded using our Audience feature. Important to note, that for a private mint you will need to pass in a merkle proof that corresponds to the merkle root added in the sale details in order to mint. Not to worry though, we provide this logic in our boilerplates by default.Step 5: Add MinterRole for Sales Contract to Collection Contract
Permissions
tab and you can Edit
, or, + Add Collaborator
.Minter
role.Step 6:
Write contract
. We will then click on the mint()
function and pass in a few parameters:to
: this is the address that the NFT is being minted to. Generally this would be the user who paid, but we can simply pass in our Builder address located in the top-right hand corner.amount
: The amount of NFTs to mint, we will simply mint 1.paymentToken
: For a custom currency, you would pass in that currency’s address. However for native tokens it will be 0x0000000000000000000000000000000000000000
.maxTotal
: The maximum amount of the given currency that can be paid.proof
: For a public mint, you can simply leave this field blank. In a private mint, this would be the generated proof that corresponds to the user’s address & previously provided merkle root.Write
to build the transaction, then Confirm
to mint the token!